package com.ruben.simplegraphql.convert;

import com.ruben.simplegraphql.util.ConvertUtil;

/**
 * Convertable
 *
 * @author VampireAchao
 * @since 2022/9/25
 */
public interface Convertable<T extends Convertable<T>> {

    /**
     * convert
     *
     * @param obj source
     * @return target
     */
    @SuppressWarnings("unchecked")
    default T convert(Object obj) {
        return (T) ConvertUtil.convert(obj, this.getClass());
    }

}
